import cryptjs from 'crypto-js';

const secretKey = 'thdislg';

/**
 * DES 加密
 * @param code 
 * @returns 
 */
export function encryptCode(code: string) {
  const cryptKey = cryptjs.enc.Utf8.parse(secretKey);
  return cryptjs.DES.encrypt(code, cryptKey, {
    mode: cryptjs.mode.ECB,
    padding: cryptjs.pad.Pkcs7
  }).toString()
}